package lib::Input::Pdf;

# This file is part of noplagia.
#
# noplagia is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# noplagia is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# noplagia; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA  02111-1307 USA

use strict;
use lib::TextTreatment;


require Exporter;
our ($VERSION,@ISA,@EXPORT,$context);

$VERSION = 0.01;

=head1 NAME

lib::Input::Pdf - pdf to text

=head1 SYNOPSIS

    use lib::Input::Pdf;
    my $text = get_text($text);

=head1 DESCRIPTION

    Ce module permet transformer un fichier pdf en text

=head1 FUNCTIONS

=over 2

=cut

@ISA    = qw(Exporter);
@EXPORT = qw(
  &get_text
);

=item get_text

    my $text = get_text($pdf);
    C<$pdf> est le path d'un fichier pdf

=cut



sub get_text{
#     use Data::Dumper;
    my ($filename)   = shift;
    # FIXME :: Code not safe !
    # FIXME :: hard depency !
    my $text =  `pdftotext -enc UTF-8 -eol unix $filename /dev/stdout`;
#     $text =~ s/</&lt;/gm;
    return set_noPunctuation($text);
}



END { }
1;
__END__

=back

=head1 AUTEUR

    noplagia dev team

    http://noplagia.org

=cut
